
package net.swa.system.util.ws.interceptor;

import java.util.List;
import javax.xml.soap.SOAPException;
import org.apache.cxf.binding.soap.SoapHeader;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.headers.Header;
import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import org.apache.log4j.Logger;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class SOAPAuthIntercepter extends AbstractPhaseInterceptor<SoapMessage>
{
    private static final Logger logger = Logger.getLogger(SOAPAuthIntercepter.class);

    public static final String xml_namespaceUR_att = "http://gd.chinamobile.com//authentication";

    public static final String xml_header_el = "n0:Header";

    public static final String xml_authentication_el = "n0:authentication";

    public static final String xml_systemID_el = "n3:systemID";

    public static final String xml_userID_el = "n1:userID";

    public static final String xml_password_el = "n2:password";

    public SOAPAuthIntercepter()
    {
        // 指定该拦截器在哪个阶段被激发
        super(Phase.PRE_INVOKE);
    }

    // 处理消息
    public void handleMessage(SoapMessage message)
    {
        logger.info("==================SoapMessage =" + message);
        if (message.getDestination() != null) {
            System.out.println(message.getId() + "#" + message.getDestination().getMessageObserver());
        }
        
    }
}
